<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>lacewing.server.ServerChannel</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="lacewing-module.html">Package&nbsp;lacewing</a> ::
        <a href="lacewing.server-module.html">Module&nbsp;server</a> ::
        Class&nbsp;ServerChannel
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="lacewing.server.ServerChannel-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ServerChannel</h1><p class="nomargin-top"><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
         |
        <strong class="uidshort">ServerChannel</strong>
</pre>

<hr />
<p>Represents a channel.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerChannel-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>,
        <span class="summary-sig-arg">id</span>,
        <span class="summary-sig-arg">hidden</span>,
        <span class="summary-sig-arg">autoClose</span>,
        <span class="summary-sig-arg">master</span>)</span><br />
      x.__init__(...) initializes x; see help(type(x)) for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerChannel-class.html#addConnection" class="summary-sig-name">addConnection</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">connection</span>)</span><br />
      Add a client to the channel, and notify the other clients.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.addConnection">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerChannel-class.html#removeConnection" class="summary-sig-name">removeConnection</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">connection</span>)</span><br />
      Remove a client from the channel, and notify the other clients.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.removeConnection">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerChannel-class.html#sendMessage" class="summary-sig-name">sendMessage</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>,
        <span class="summary-sig-arg">subchannel</span>=<span class="summary-sig-default">0</span>,
        <span class="summary-sig-arg">fromConnection</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">asObject</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">typeName</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">**settings</span>)</span><br />
      Send a channel message from the given protocol instance.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.sendMessage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerChannel-class.html#sendPrivateMessage" class="summary-sig-name">sendPrivateMessage</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>,
        <span class="summary-sig-arg">subchannel</span>,
        <span class="summary-sig-arg">sender</span>,
        <span class="summary-sig-arg">recipient</span>,
        <span class="summary-sig-arg">asObject</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">typeName</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">**settings</span>)</span><br />
      Send a message from this client to a recipient</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.sendPrivateMessage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="sendLoader"></a><span class="summary-sig-name">sendLoader</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">type</span>,
        <span class="summary-sig-arg">notClients</span>=<span class="summary-sig-default"><code class="variable-group">[</code><code class="variable-group">]</code></span>,
        <span class="summary-sig-arg">**settings</span>)</span><br />
      Send the specified type to all the clients in the channel, apart from
      notClients if specified.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.sendLoader">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="hidden"></a><span class="summary-name">hidden</span> = <code title="False">False</code>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="id"></a><span class="summary-name">id</span> = <code title="None">None</code><br />
      ID of the channel.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="name"></a><span class="summary-name">name</span> = <code title="None">None</code><br />
      The name of the channel.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="autoClose"></a><span class="summary-name">autoClose</span> = <code title="False">False</code><br />
      True if this channel will close after the master leaves
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="lacewing.server.ServerProtocol-class.html" 
      class="link">ServerProtocol</a> object</span>
    </td><td class="summary">
        <a name="master"></a><span class="summary-name">master</span> = <code title="None">None</code><br />
      The master connection of this channel
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="connections"></a><span class="summary-name">connections</span><br />
      List of the clients in the channel.
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Properties</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>,
        <span class="sig-arg">id</span>,
        <span class="sig-arg">hidden</span>,
        <span class="sig-arg">autoClose</span>,
        <span class="sig-arg">master</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see help(type(x)) for signature</p>
  <dl class="fields">
    <dt>Overrides:
        object.__init__
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="addConnection"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">addConnection</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">connection</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.addConnection">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Add a client to the channel, and notify the other clients.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>connection</code></strong> - The protocol instance to add.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="removeConnection"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">removeConnection</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">connection</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.removeConnection">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Remove a client from the channel, and notify the other clients.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>connection</code></strong> - The protocol instance to remove.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="sendMessage"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sendMessage</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>,
        <span class="sig-arg">subchannel</span>=<span class="sig-default">0</span>,
        <span class="sig-arg">fromConnection</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">asObject</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">typeName</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">**settings</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.sendMessage">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Send a channel message from the given protocol instance.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>fromConnection</code></strong> - The client that the message is sent from (or None if the message 
          is from the server).</li>
        <li><strong class="pname"><code>message</code></strong> (str/number/ByteReader) - The message to send.</li>
        <li><strong class="pname"><code>subchannel</code></strong> (number) - The subchannel to send the message on.</li>
        <li><strong class="pname"><code>typeName</code></strong> - If not specified, the type will be automatically detected (see <a
          href="lacewing.packetloaders.common-module.html#DATA_TYPES" 
          class="link">lacewing.packetloaders.common.DATA_TYPES</a> for 
          possible values)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="sendPrivateMessage"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sendPrivateMessage</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>,
        <span class="sig-arg">subchannel</span>,
        <span class="sig-arg">sender</span>,
        <span class="sig-arg">recipient</span>,
        <span class="sig-arg">asObject</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">typeName</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">**settings</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerChannel.sendPrivateMessage">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Send a message from this client to a recipient</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>subchannel</code></strong> - The subchannel of the message in the range 0-256</li>
        <li><strong class="pname"><code>sender</code></strong> (<a href="lacewing.server.ServerProtocol-class.html" 
          class="link">ServerProtocol</a> object) - Sending connection</li>
        <li><strong class="pname"><code>recipient</code></strong> (<a href="lacewing.server.ServerProtocol-class.html" 
          class="link">ServerProtocol</a> object) - Connection to send message to</li>
        <li><strong class="pname"><code>typeName</code></strong> - If not specified, the type will be automatically detected (see <a
          href="lacewing.packetloaders.common-module.html#DATA_TYPES" 
          class="link">lacewing.packetloaders.common.DATA_TYPES</a> for 
          possible values)</li>
        <li><strong class="pname"><code>message</code></strong> (str/number/ByteReader)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Dec 22 06:19:59 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
